package arch.coal.ellipse.security.tables;

import java.sql.ResultSet;

public abstract class BasicTable {
	
	protected StringBuffer sqlSelectStmt;
	protected String tableName;
	
	public BasicTable() {
		sqlSelectStmt = new StringBuffer();
		populateSqlSelectStmt();
	}
	
	public void addWhereClause(String where) {
		sqlSelectStmt.append(" " + where);
	}

	abstract void setTableName(String table);
	
	public String getTableName() {
		return tableName;
	}
	
	abstract void populateSqlSelectStmt(); 
	
	public String getSqlSelectStmt() {
		return sqlSelectStmt.toString();
	}
	
	public abstract void processResultSet(ResultSet rs) throws Exception;

}
